import React, { Component } from 'react'
// import Car from './Car/index'
// import Child from './Child/index'
import Input from './Input/index'

class Home extends Component {

    state = {
        name: '杨紫龙'
    }

    getData (name,value) {
        this.setState({
            [name]: value
        })
    }

    render() { 
        let { name } = this.state
        return (
            <div>
                {/* <Car name='111'/>
                <Child title='222' /> */}
                <Input getData={this.getData.bind(this)} />
                <div>
                    <span>姓名：</span><p>{name}</p>
                </div>
            </div>
        )
    }
}
 
export default Home